package de.wesemann.mediahandbook.le.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import de.wesemann.jdedun.entities.mediahandbook.people.MediahandbookPeople;
import de.wesemann.jdedun.implementation.mediahandbook.MediahandbookPeopleReq;

public class PeopleUtil {
	private static final MediahandbookPeopleReq PEOPLE_REQ = new MediahandbookPeopleReq();

	public static List<MediahandbookPeople> getPeople(List<Integer> peopleIds) {

		List<MediahandbookPeople> peoples = new ArrayList<MediahandbookPeople>();
		HashMap<String, String> searchTuple = new HashMap<String, String>();
		if (peopleIds != null) {
			for (Integer peopleId : peopleIds) {
				searchTuple.put("id", Integer.toString(peopleId));
				peoples.add(PEOPLE_REQ.search(searchTuple).get(0));
			}
			return peoples;
		}
		return null;
	}
}
